using Imaginarium.jobs;

using System.Collections.Generic;
using Imaginarium.stats;
using System.Xml;
using Imaginarium.XML;
using Imaginarium.team;
namespace Imaginarium.items.equip
{
    public class Equipment : Item
    {

        public int minAgi { get; set; }
        public int minBaseLvl { get; set; }
        public int minDex { get; set; }
        public int minInt { get; set; }
        public int minStr { get; set; }
        public List<Job> jobsPermitted { get; set; }
        public List<EquipmentPosition> positionPermitted { get; set; }
        public Stats equipmentStats { get; set; }
        public List<DetailSpecialState> posibleStates { get; set; }

        public Equipment()
        {

        }
        public Equipment(XmlElement element)
        {
            minAgi = XmlHelper.getIntByTagname(element, XmlParameters.EQUIPMENT_MIN_AGI);
            minBaseLvl = XmlHelper.getIntByTagname(element, XmlParameters.EQUIPMENT_MIN_BASE_LVL);
            minDex= XmlHelper.getIntByTagname(element, XmlParameters.EQUIPMENT_MIN_DEX);
            minInt = XmlHelper.getIntByTagname(element, XmlParameters.EQUIPMENT_MIN_INT);
            minStr = XmlHelper.getIntByTagname(element, XmlParameters.EQUIPMENT_MIN_STR);
            XmlNodeList jp = XmlHelper.getXmlNodeListByTagname(element, XmlParameters.EQUIPMENT_JOBS_PERMITTED);
            foreach (XmlElement xe in jp) { 
                jobsPermitted.Add(XmlLoader.loadJob(XmlHelper.getIntByTagname(element,XmlParameters.JOB_ID)));
            }
            XmlNodeList positionP = XmlHelper.getXmlNodeListByTagname(element, XmlParameters.EQUIPMENT_POSITION_PERMITTED_LIST);
            foreach (XmlElement xe in positionP)
            {
                positionPermitted.Add((EquipmentPosition)XmlHelper.getIntByTagname(element,XmlParameters.EQUIPMENT_POSITION_PERMITTED));
            }
            equipmentStats = new Stats(XmlHelper.getXmlElementByTagname(element, XmlParameters.EQUIPMENT_STATS));
        }



        

    }
}